import request from "@/utils/request";

// 获取所有的Role
export function getAll() {
  return request({
    url: "rest/api/role/all",
    method: "get"
  });
}

export function add(data) {
  return request({
    url: "rest/api/role",
    method: "post",
    data
  });
}

export function get(id) {
  return request({
    url: "rest/api/role/" + id,
    method: "get"
  });
}

export function getLevel() {
  return request({
    url: "rest/api/role/level",
    method: "get"
  });
}

export function del(ids) {
  return request({
    url: "rest/api/role/del",
    method: "post",
    data: ids
  });
}

export function edit(data) {
  return request({
    url: "rest/api/role/update",
    method: "post",
    data
  });
}

export function editMenu(data) {
  return request({
    url: "rest/api/role/menu",
    method: "post",
    data
  });
}

export default { add, edit, del, get, editMenu, getLevel, getAll };
